//判断购物车内是否有数据，有，赋值。没有，赋空数组
var car = JSON.parse(localStorage.getItem('car') || '[]'),
  totalMount = Number(localStorage.getItem('totalMount') || '0'),
  totalPrice = Number(localStorage.getItem('totalPrice') || '0'),
  product = JSON.parse(localStorage.getItem('product') || '[]')
export default {
  islogin: JSON.parse(sessionStorage.getItem('islogin')), //保存是否已登录
  username: sessionStorage.getItem('name'), //保存当前登录用户名
  userid: sessionStorage.getItem('id'),
  car: car, //购物车中的商品数据，
  totalMount: totalMount, //购物车中商品总数
  totalPrice: totalPrice, //购物车中商品总价格
  product: product,
}